#ifndef CHECKBOX_H
#define CHECKBOX_H

#include <QWidget>
#include <QMouseEvent>
#include <QPainter>
#include <QPushButton>
#include <QDebug>

namespace Ui {
class CheckBox;
}

class CheckBox : public QWidget
{
    Q_OBJECT
public:
    explicit CheckBox(QWidget *parent = nullptr);
    ~CheckBox();
    void mousePressEvent(QMouseEvent*event) override;
    void mouseMoveEvent(QMouseEvent*event)  override;
    void mouseReleaseEvent(QMouseEvent*event)   override;
    void paintEvent(QPaintEvent *event) override;
    void closeEvent(QCloseEvent *event) override;
    QString Title;
    QString Info;
    QString btn1_name;
    QString btn2_name;
    static int check; //-1为未选择, 1为OK, 2为Cancle
private slots:
    void on_btnOk_clicked();

    void on_btnCan_clicked();

private:
    Ui::CheckBox *ui;
    QPoint curPos;
    bool isPressed;
};

#endif // CHECKBOX_H
